/*----------------------------------------------------------------------
* Copyright (C) 2013 - 2014: Sergey Smolyannikov <brainstream@yandex.com>
*
* This file is part of lxpamon.
*
* lxpamon is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* lxpamon is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with lxpamon. If not, see http://www.gnu.org/licenses/gpl-3.0.txt.
----------------------------------------------------------------------*/

#ifndef __LXPAMON_PAMON_INCLUDED__
#define __LXPAMON_PAMON_INCLUDED__

#include <stdint.h>

#define PAMON_UNUSED(var) (void)var

typedef struct Pamon Pamon;

typedef enum
{
    PAMON_ERROR_CONNECTION_FAILED,
    PAMON_ERROR_INVALID_SINK
} PamonError;

typedef void (* PamonVolumeChangedCallback)(uint32_t current_volume_percents, void * userdata);
typedef void (* PamonErrorCallback)(PamonError error, void * userdata);

typedef struct
{
    uint32_t sink_id;
    PamonVolumeChangedCallback volume_callback;
    PamonErrorCallback error_callback;
    void * userdata;
} PamonInitData;

Pamon * pamonInit(PamonInitData * init_data);

void pamonSetSinkId(Pamon * pamon, uint32_t id);

int pamonStart(Pamon * pamon);

void pamonClose(Pamon * pamon);

const char * pamonTranslateError(PamonError error);

#endif // __LXPAMON_PAMON_INCLUDED__
